<template>
  <el-container style="min-height: 100vh">

    <el-aside :width="sideWidth + 'px' " style="box-shadow: 2px 0 6px rgb(0 21 41)">
      <Aside :isCollapse="isCollapse" :logoTextShow="logoTextShow"/>
    </el-aside>

    <el-container>


      <el-header style="border-bottom: 1px solid #ccc;">
        <Header :collapseBtnClass="collapseBtnClass" @asideCollapse="collapse"/>
      </el-header>

      <el-main>
        <router-view />
      </el-main>


    </el-container>
  </el-container>
</template>

<style>
</style>

<script>

import Aside from "@/components/Aside";
import Header from "@/components/Header";


export default {
  name: 'HomeView',
  data() {
    return {
      collapseBtnClass: 'el-icon-arrow-left',
      isCollapse: false,
      sideWidth: 200,
      logoTextShow: true
    }
  },
  components: {
    Aside,
    Header
  },
  methods: {
    collapse() { //收缩触发
      this.isCollapse = !this.isCollapse
      if (this.isCollapse) { //收缩
        this.sideWidth = 64
        this.collapseBtnClass = 'el-icon-arrow-right'
        this.logoTextShow = false
      } else { //展开
        this.sideWidth = 200
        this.collapseBtnClass = 'el-icon-arrow-left'
        this.logoTextShow = true
      }
    }
  }
}
</script>


